#include "MsgInfo.h"


MsgInfoIn::MsgInfoIn()
{
	energy = 0;
	shields = 0;
	missiles = 0;

	stars = 0;
	enemies = 0;
	turns = 0;
	stations = 0;

	Vpos = 0;
	posQX = 0;
	posQY = 0;

	posX = 0;
	posY = 0;

	hyperdrive = false;
	sublight = false;
	scanner = false;
	missile = false;
	blaster = false;
	shield = false;

}
void MsgInfoIn::ConvertCoords(int x, int y)
{
	posX = x;
	posY = y;

	Vpos = (y*8)+x;
}

void MsgInfoIn::SetShip(int en, int sh, int mi)
{
	energy = en;
	shields = sh;
	missiles = mi;
}
void MsgInfoIn::SetPos(int qx,int qy,int x,int y) 
{
	posQX = qx;		posQY = qy;
	posX = x;		posY = y;
}
void MsgInfoIn::SetSystems(bool hd,bool sl,bool sc,bool mi,bool bl,bool sh)
{
	hyperdrive = hd;
	sublight = sl;
	scanner = sc;
	missile = mi;
	blaster = bl;
	shield = sh;
}

void MsgInfoIn::SetGameStatus(int s, int en, int t, int st)
{
	stars = st;
	enemies = en;
	turns = t;
	stations = st;
}





/////////////////////////////////////////////////////////
//
MsgInfoOut::MsgInfoOut()
{
	click = 0;
	type = ' ';
	posX = 0;
	posY = 0;
	shieldUpdate = false;

}
//converts vector position into an x and y to send to server
void MsgInfoOut::ConvertCoords(int a)
{
	posX = a % 8;
	posY = a / 8;
}

void MsgInfoOut::SetInfo(int c, char t, int p)
{
	click = c;
	type = t;
	ConvertCoords(p);//converts position in vector to x and y for 2d array
}
